package com.namecard.namecardapi.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.namecard.namecardapi.entity.TCommodity;
import com.namecard.namecardapi.entity.vo.TCommodityVo;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zm
 * @since 2024-04-21
 */
public interface TCommodityService extends IService<TCommodity> {

    /**
     * 查询全部商品分页
     * @param pageParam
     * @param commodityVo
     * @return
     */
    IPage<TCommodity> selectAll(Page<TCommodity> pageParam, TCommodityVo commodityVo);

    /**
     * 通过id删除商品
     * @param id
     */
    void delectById(Long id);

    /**
     * 通过id上下架商品
     * @param tCommodity
     */
    void updateByState(TCommodity tCommodity);

    /**
     * 通过id修改是否滚动
     * @param tCommodity
     */
    void updateByRoll(TCommodity tCommodity);

    /**
     * 添加商品
     * @param tCommodity
     * @return
     */
    int insertCommdity(TCommodity tCommodity);

    //通过id获取商品信息
    TCommodity getInfoById(Long id);
}
